﻿using AuSys.Models.App;
using AuSys.Repos;
using AuSys.Test.TestSupport.Fakes;
using Microsoft.EntityFrameworkCore;

namespace AuSys.Test.Repos.App.TestSupport
{
    public class MockRepo(
        FakeDataContext context
        ) : Repo<FakeEntity>(context)
    {
        public bool SettableEnableLastUpdateRecord { get; set; }
        protected override bool EnableLastUpdateRecord
            => SettableEnableLastUpdateRecord;
        public int PublicAdd(FakeEntity item, bool saveChanges = true)
            => base.Add(item, saveChanges);
        public void PublicUpdate(FakeEntity item, bool saveChanges = true)
            => base.Update(item, saveChanges);
        public void PublicFakeRemove(FakeEntity item, bool saveChanges = true)
            => base.FakeRemove(item, saveChanges);


        public DbSet<LastUpdateRecord> GetLastUpdateSet()
            => context.Set<LastUpdateRecord>();
        public DateTime PublicReadLastUpdate()
            => base.ReadLastUpdate();
    }
}
